#pragma once


#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <assert.h>
#include <time.h>

typedef int BTDataType;

typedef struct binaryTreeNode {
	struct binaryTreeNode* left;
	struct binaryTreeNode* right;
	BTDataType data;
}BTNode;

BTNode* buyNode(BTDataType x);
BTNode* CreateBinaryTree();
void prevOrder(BTNode* root);
void inOrder(BTNode* root);
int treeSize2(BTNode* root);
int treeLeafSize(BTNode* root);
int treeKLevelSize(BTNode* root, int k);
BTNode* treeFind(BTNode* root, BTDataType x);
int treeDepth(BTNode* root);
void preOrderCompare(BTNode* root, int val);
bool isUnivalTree1(BTNode* root);
bool isUnivalTree2(BTNode* root);
bool isSymmetric(BTNode* root);
bool isSubtree(BTNode* root, BTNode* subroot);
int* preorderTraversal(BTNode* root, int* returnsize);
BTNode* createTree(char* str, int* pi);
